package services;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import com.aton.db.SessionFactory;

import models.Oplog;
import models.mappers.OplogMapper;
import vos.OplogSearchVo;

/**
 * 操作日志操作类
 * 
 * @ClassName: OplogService 
 * @author: wangsm
 * @date: 2016年5月27日 下午3:33:03
 */
public class OplogService {
	/**
	 * 统计操作日志
	 *
	 * @Title: countOplog 
	 * @param vo
	 * @return
	 * @return: long
	 */
	public static long countOplog(OplogSearchVo vo) {
		SqlSession ss = SessionFactory.getSqlSession();
		try {
			OplogMapper mapper = ss.getMapper(OplogMapper.class);
            return mapper.countOplog(vo);
        } finally {
            ss.close();
        }
	}
	/**
	 * 获取操作日志列表
	 *
	 * @Title: listOplog 
	 * @param vo
	 * @return
	 * @return: List<Oplog>
	 */
	public static List<Oplog> listOplog(OplogSearchVo vo) {
		SqlSession ss = SessionFactory.getSqlSession();
		try {
			OplogMapper mapper = ss.getMapper(OplogMapper.class);
            return mapper.listOplog(vo);
        } finally {
            ss.close();
        }
	}
	/**
	 * 导出excel
	 *
	 * @Title: exportXls 
	 * @param vo
	 * @return
	 * @return: List<Oplog>
	 */
	public static List<Oplog> exportXls(OplogSearchVo vo) {
		SqlSession ss = SessionFactory.getSqlSession();
		try {
			OplogMapper mapper = ss.getMapper(OplogMapper.class);
            return mapper.exportXls(vo);
        } finally {
            ss.close();
        }
	}
	
}
